-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add user ID validation and custom error handling in ModelWithPermissions #7605
base: production
Are you sure you want to change the base?
Add user ID validation and custom error handling in ModelWithPermissions #7605
Conversation
… appending permissions
…nvalid user ID checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some minor comments. There are some e2e failing, please rerun the failed tests until they are green. Thanks.
@@ -127,20 +128,44 @@ const controlPermissionsData = <T>( | |||
return { ...data, permissions: undefined }; | |||
}; | |||
|
|||
export class InvalidUserIdError extends Error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure about the Error practices we defined. Are we extending native JS Error or are we using our Uwazi Error? I thought we agreed the latter, but maybe I misunderstood something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, is there any code example of this so I can replicate same behavior here ?
…add-user-id-validation-to-permissions-model
fixes #7389